package com.qinaxiwit.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.qianxi.wit.pojo.TbCenter;
import com.qinaxiwit.mapper.TbCenterMapper;
import com.qinaxiwit.service.TbCenterService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.management.Query;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author wyh
 * @since 2021-01-14
 */
@Service
public class TbCenterServiceImpl extends ServiceImpl<TbCenterMapper, TbCenter> implements TbCenterService {

    @Autowired
    private TbCenterMapper centerMapper;

    @Override
    public Long[] findAll(long[] ids) {
        String a = "";
        for(int i =0 ;i < ids.length; i++){
                if (ids[i] != 0){
                a+=ids[i]+",";
            }
        }
        String s = a.substring(0,a.length()-1);
        List<TbCenter> list = centerMapper.findIds(s);
        Long[] doctorId= new Long[10];
        for (int i=0; i<list.size();i++){
            doctorId[i]=list.get(i).getDoctorId();
        }
        System.out.println(doctorId);
        return doctorId;
    }
}
